\section{user\_\-handler::music\_\-acceptor Class Reference}
\label{classuser__handler_1_1music__acceptor}\index{user_handler::music_acceptor@{user\_\-handler::music\_\-acceptor}}
This class handles new connection from the connection\_\-listener which listens on the music-port.  


{\tt \#include $<$music\_\-acceptor.h$>$}

Inheritance diagram for user\_\-handler::music\_\-acceptor::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classuser__handler_1_1music__acceptor}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{music\_\-acceptor} (boost::shared\_\-ptr$<$ \bf{network::connection\_\-manager} $>$ mgr, boost::weak\_\-ptr$<$ \bf{handler::multicaster} $>$ multi, boost::shared\_\-ptr$<$ \bf{music::music\_\-system} $>$ music)
\begin{CompactList}\small\item\em \doxyref{music\_\-acceptor}{p.}{classuser__handler_1_1music__acceptor} creates the acceptor \item\end{CompactList}\item 
virtual \bf{$\sim$music\_\-acceptor} ()\label{classuser__handler_1_1music__acceptor_7e238310b33770e85122042cfe7185b9}

\item 
virtual void \bf{handle\_\-event} (boost::shared\_\-ptr$<$ \bf{network::message} $>$ n)
\begin{CompactList}\small\item\em handle\_\-event handles received events. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class handles new connection from the connection\_\-listener which listens on the music-port. 



Definition at line 41 of file music\_\-acceptor.h.

\subsection{Constructor \& Destructor Documentation}
\index{user_handler::music_acceptor@{user\_\-handler::music\_\-acceptor}!music_acceptor@{music\_\-acceptor}}
\index{music_acceptor@{music\_\-acceptor}!user_handler::music_acceptor@{user\_\-handler::music\_\-acceptor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}user\_\-handler::music\_\-acceptor::music\_\-acceptor (boost::shared\_\-ptr$<$ \bf{network::connection\_\-manager} $>$ {\em mgr}, boost::weak\_\-ptr$<$ \bf{handler::multicaster} $>$ {\em multi}, boost::shared\_\-ptr$<$ \bf{music::music\_\-system} $>$ {\em music})\hspace{0.3cm}{\tt  [inline]}}\label{classuser__handler_1_1music__acceptor_88df99fadf062b4b67f1a640318ddd36}


\doxyref{music\_\-acceptor}{p.}{classuser__handler_1_1music__acceptor} creates the acceptor 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mgr}]is a pointer to the connection-manager \item[{\em multi}]is a pointer to the multicaster \item[{\em music}]is a pointer to the music-system \end{description}
\end{Desc}


Definition at line 50 of file music\_\-acceptor.h.

\begin{Code}\begin{verbatim}54                 :_mgr(mgr), _multi(multi), _music(music) {}
\end{verbatim}\end{Code}




\subsection{Member Function Documentation}
\index{user_handler::music_acceptor@{user\_\-handler::music\_\-acceptor}!handle_event@{handle\_\-event}}
\index{handle_event@{handle\_\-event}!user_handler::music_acceptor@{user\_\-handler::music\_\-acceptor}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void user\_\-handler::music\_\-acceptor::handle\_\-event (boost::shared\_\-ptr$<$ \bf{network::message} $>$ {\em n})\hspace{0.3cm}{\tt  [virtual]}}\label{classuser__handler_1_1music__acceptor_7e2e6d08f882d5305dbb4875479af0b8}


handle\_\-event handles received events. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em n}]is the received message. \end{description}
\end{Desc}


Implements \bf{handler::event\_\-handler} \doxyref{p.}{classhandler_1_1event__handler_7ff75131a32fb17cf4addc4581344bff}.

Definition at line 3 of file music\_\-acceptor.cpp.

\begin{Code}\begin{verbatim}5 {
6         // accepting the connection...
7         if(e->type == network::CONNECT) {
8                 boost::shared_ptr<user_handler::music_handler> han(
9                   user_handler::music_handler::create(e->new_sock, _music));
10                 boost::shared_ptr<handler::multicaster> multi(_multi.lock());
11                 multi->add_handler(network::RECEIVE, e->new_sock, han);
12                 multi->add_handler(network::DELETE, e->new_sock, han);
13                 _mgr->add_recv(e->new_sock, 
14                         network::configurator::get_music_filetype());
15         }
16 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
user\_\-handler/music\_\-acceptor.h\item 
user\_\-handler/music\_\-acceptor.cpp\end{CompactItemize}
